home *** CD-ROM | disk | FTP | other *** search
/ Aminet 39 / Aminet 39 (2000)(Schatztruhe)[!][Oct 2000].iso / Aminet / gfx / misc / imaged.lha / ImageDescriptor2.2 / Install < prev   
Encoding:
Text File  |  2000-08-03  |  6.2 KB  |  312 lines

  1. ;$VER: Image Descriptor Setup Script 2.1 (10.01.2000) 
  2. ;
  3.  
  4. (ONERROR (CLEANUP))
  5.  
  6. ;··· ·· · cleanup · ·· ···
  7.  
  8. (procedure CLEANUP
  9.     (delete "installerfx/install")
  10. )
  11.  
  12.  
  13. ;··· ·· · Installation procedure · ·· ···
  14.  
  15. (procedure SETUP
  16.  
  17. (working "\n\n\n\n\nPreparing ...")
  18. (copyfiles (prompt) (help @copyfiles-help) (source "installerfx/install.iff") (dest "installerfx") (newname "install") (nogauge))
  19. (run "run <>nil: installerfx/installerfx installerfx/install")
  20. (run "installerfx/wintofront")
  21.  
  22. (message
  23.     "\n\n\n"
  24.     #app-name " is MAILWARE\n"
  25.     "(it means You must send me an e-mail)\n\n"
  26.     #app-name " supports GIF format for\n"
  27.     "loading and saving but do not (de)compress it\n"
  28.     "so LZW algorithm is not used here\n\n"
  29.     "If that method of using GIF is illegal too\n"
  30.     "please let me know and GIF support will be removed"
  31. )
  32. (set #icon
  33.     (askchoice
  34.         (prompt "\nWhich type of icon you wish to install ?\n")
  35.         (help    @askchoice-help)
  36.         (choices
  37.            "pStandard icon"
  38.            "MagicWB icon"
  39.            "NewIcons icon"
  40.            "OS 3.5 icon"
  41.         )
  42.     )
  43. )
  44. (set #doc-type
  45.     (askchoice
  46.         (prompt "\nPlease select documentation format.\n")
  47.         (help    @askchoice-help)
  48.         (choices
  49.             "pASCII text file"
  50.             "AmigaGuide ® document"
  51.             "HTML document"
  52.         )
  53.     )
  54. )
  55. (set #dest
  56.     (askdir
  57.         (prompt ("\nPlease select drawer for main program.\n"))
  58.         (help @askdir-help)
  59.         (default "Work:")
  60.     )
  61. )
  62. (set #doc_dest
  63.     (askdir
  64.         (prompt "\nPlease select drawer for documentation files.\n")
  65.         (help @askdir-help)
  66.         (default "HELP:english")
  67.     )
  68. )
  69. (message
  70.     "\n\n\n\n\n\n\nInstaller have enough informations now to begin "
  71.     "installation\n\n"
  72. )
  73.  
  74. ;··· ·· · Create id2 drawer in ENVARC: · ·· ···
  75. (working "\n\n\n\n\nCreating " #app-name " drawer in ENV: ...")
  76. (makedir "ENVARC:ImageDescriptor"
  77.     (prompt "")
  78.     (help    @makedir-help)
  79. )
  80.  
  81. ;··· ·· · Copy main file · ·· ···
  82. (working "\n\n\n\n\nCopying " #app-name " executable ...")
  83. (copyfiles
  84.     (prompt "")
  85.     (source "Program/id2")
  86.     (dest #dest)
  87.     (nogauge)
  88. )
  89.  
  90. (set #main_name (tackon #dest "id2"))
  91. (set #main_icon (tackon #dest "id2.info"))
  92.  
  93. ;··· ·· · Copy documentation file · ·· ···
  94. (working "\n\n\n\n\nCopying " #app-name " documentation ...")
  95. (if
  96.     (= #doc-type "1")
  97.     (
  98.         (copyfiles
  99.             (prompt "")
  100.             (help @copyfiles-help)
  101.             (source "program/id2.guide")
  102.             (dest #doc_dest)
  103.             (newname "id2.guide")
  104.             (nogauge)
  105.         )
  106.     (set #doc_name (tackon #doc_dest "id2.guide"))
  107.     )
  108. )
  109. (if
  110.     (= #doc-type "0")
  111.     (
  112.         (copyfiles
  113.             (prompt "")
  114.             (help @copyfiles-help)
  115.             (source "program/id2.txt")
  116.             (dest #doc_dest)
  117.             (newname "id2.txt")
  118.             (nogauge)
  119.         )
  120.     (set #doc_name (tackon #doc_dest "id2.txt"))
  121.     )
  122. )
  123. (if
  124.     (= #doc-type "2")
  125.     (
  126.         (copyfiles
  127.             (prompt "")
  128.             (help @copyfiles-help)
  129.             (source "program/id2.html")
  130.             (dest #doc_dest)
  131.             (newname "id2.html")
  132.             (nogauge)
  133.         )
  134.     (set #doc_name (tackon #doc_dest "id2.html"))
  135.     )
  136. )
  137.  
  138. ;··· ·· · Copy icon · ·· ···
  139. (working "\n\n\n\n\nCopying " #app-name " icon ...")
  140. (if
  141.     (= #icon "0")
  142.     (
  143.                (copyfiles
  144.             (help @copyfiles-help)
  145.             (source "Icons/nor/id2.info")
  146.             (dest #dest)
  147.             (nogauge)
  148.         )
  149.     )
  150. )
  151. (if
  152.     (= #icon "1")
  153.     (
  154.                (copyfiles
  155.             (help @copyfiles-help)
  156.             (source "Icons/mwb/id2.info")
  157.             (dest #dest)
  158.             (nogauge)
  159.         )
  160.     )
  161. )
  162. (if
  163.     (= #icon "2")
  164.     (
  165.                (copyfiles
  166.             (help @copyfiles-help)
  167.             (source "Icons/new/id2.info")
  168.             (dest #dest)
  169.             (nogauge)
  170.         )
  171.     )
  172. )
  173. (if    
  174.     (= #icon "3")
  175.     (
  176.         (copyfiles
  177.             (help @copyfiles-help)
  178.             (source "Icons/v35/id2.info")
  179.             (dest #dest)
  180.             (nogauge)
  181.         )
  182.     )
  183. )
  184.  
  185. (copyfiles
  186.     (prompt)
  187.     (help @copyfiles-help)
  188.     (source #main_icon)
  189.     (dest "envarc:imagedescriptor")
  190.     (nogauge)
  191. )
  192.  
  193. (working "\n\n\n\n\nCreating uninstall information ...")
  194. (textfile
  195.     (prompt)
  196.     (help @textfile-help)
  197.     (dest "ENVARC:ImageDescriptor/version")
  198.     (append #id_version)
  199. )
  200. (textfile
  201.     (prompt)
  202.     (help @textfile-help)
  203.     (dest "ENVARC:ImageDescriptor/unInstall")
  204.     (append "delete <>NIL: ENVARC:ImageDescriptor force all\n")
  205.     (append "delete <>NIL: ENV:ImageDescriptor force all\n")
  206.     (append "delete <>NIL: "#main_name" force\n")
  207.     (append "delete <>NIL: "#main_icon" force\n")
  208.     (append "delete <>NIL: "#doc_name" force\n")
  209. )
  210. (working "\n\n\n\n\nRemoving unwanted files ...")
  211. (CLEANUP)
  212. (exit     "\n\n\n\n\n"
  213.     "Thank you for choosing " #app-name "\nHope you enjoy it."
  214.     "\n\nTo remove it please use this script again"
  215. (quiet))
  216. )
  217.  
  218. ; ··· ·· · Uninstall procedure · ·· ···
  219.  
  220. (procedure REMOVE
  221.  
  222. (set #un_standard "envarc:imagedescriptor/uninstall")
  223. (set #ask_std "0")
  224.  
  225. (set @user-level 2)
  226. (set #details (getenv "imagedescriptor/uninstall"))
  227. (message
  228.     "\n\n\n"
  229.     "Installer has found uninstall information\n"
  230.     "and its ready to remove files.\n\n"
  231.     "Make sure that any of "@app-name" "#ver_actual" files \n"
  232.     "are not in use during uninstall process\n\n"
  233.     "Press HELP for details\n\n"
  234.     (help "Installer has found uninstall information\n"
  235.     "and will perform following AmigaDOS commands:\n\n"
  236.     #details)
  237. )
  238.  
  239. (working "\n\n\n\n\nRemoving files ...")
  240. (execute #un_standard)
  241. (if
  242.     (= #what_do "1")
  243.  
  244.     (exit     "\n\n\n\n\n\n"
  245.     @app-name " " #ver_actual " was succesfully uninstaled."
  246.     "\n\nThank You."
  247.     (quiet)
  248. ))
  249. )
  250. ;··· ·· · Begin of script · ·· ···
  251.  
  252. (trap CLEANUP)
  253. (iconinfo
  254.     (prompt)
  255.     (help @iconinfo-help)
  256.     (dest "install")
  257.     (gettooltype "VERSION" "#id_version")
  258. )
  259. (set #app-name (cat @app-name " " #id_version))
  260. (message "\n\n::: :: :   Welcome to " #app-name " Setup   : :: :::\n"
  261.      "\n\n"
  262.      #app-name " created by\n(c) 2000 Tomasz Malerczyk"
  263.      "\n\n"
  264.      "Please visit\nhttp://www.imagedescriptor.prv.pl/\nfor latest versions !\n"
  265.      "\n"
  266.      "Do you wish to proceed?"
  267. )
  268. (if (=(exists "envarc:imagedescriptor/uninstall") 0)
  269.     (SETUP)
  270. )    
  271. (set #un_version "envarc:imagedescriptor/version")
  272. (set #ver_actual "2.0")
  273. (if
  274.     (=(exists "envarc:imagedescriptor/version") 1)
  275.     (set #ver_actual (getenv #un_version))
  276. )
  277. (set #un_ask1 (cat "pInstall version "#id_version))
  278. (set #un_ask2 (cat "Remove version "#ver_actual" and install version "#id_version))
  279. (set #un_ask3 (cat "Remove version "#ver_actual))
  280. (set #what_do
  281. (askchoice
  282.     (prompt 
  283.     "Installer found "@app-name" Uninstall information\n"
  284.     "(pre 2.0 versions are not recognized by this script)\n\n"
  285.     "Current version: "#id_version"\n"
  286.     "Installed version: "#ver_actual"\n\n"
  287.     "What you wish to do?\n")
  288.     (help)
  289.     (choices
  290.         #un_ask1
  291.         #un_ask3
  292.         #un_ask2
  293.     )
  294.     (default 1)
  295. ))
  296. (if
  297.     (= #what_do "0")
  298.         (
  299.         (SETUP)
  300.         )
  301. )
  302. (if
  303.     (= #what_do "2")
  304.     (
  305.     (REMOVE)
  306.     (SETUP)
  307.     )
  308. )
  309. (REMOVE)
  310. (exit (quiet))
  311. (welcome "thank you")
  312.